<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');


//首页
class Index extends CT_Controller
{

    public function __construct()
    {
        parent::__construct();
        
        $this->load->model('book_model');
        $this->load->model('order_model');
        $this->load->model('book_evaluate_model');
    }

    public function index()
    { 
        $condition = array(
            'nursery_id' => $this->_nursery_id,
            'status <> 4'=> NULL
        );
        //获取约课总数
        $data['book_total'] = $this->book_model->findCount( $condition );
        
        
        $condition = array(
            'nursery_id' => $this->_nursery_id,
            'status in(1,5)' => NULL
        );
        //获取订单总数
        $data['order_total'] = $this->order_model->findCount( $condition );
        
        $condition = array(
            'nursery_id' => $this->_nursery_id,
            'book_evaluate.status'=>1
            
        );
        //获取评价总数
        $data['evaluate_total'] = $this->book_evaluate_model->evaluate_count( $condition );
        
        
        $this->ct_template->write('_title', '首页');
        $this->ct_template->write('breadcrum', '');
        $this->ct_template->write_view('content', 'nursery/index/index', $data, FALSE);
        $this->ct_template->render();

    }


}
